<template>
  <div class="header">
    <router-link to="/mainlayout/" style="color: white;">首页</router-link>
    <el-button type="primary" round style="float:right" @click="returnlogin">登出</el-button>
    <div style="float:right">
    <p style="color :white ;float:right">{{username}}</p>
      <el-avatar icon="el-icon-user-solid"></el-avatar>
    </div>
  </div>
    
</template>

<script>
export default {
  data(){
    return {
      username:window.sessionStorage.getItem("username")

    }
  },
  methods:{
    returnlogin(){
      window.sessionStorage.clear()
      window.location.replace('/')
    }
  }
}
</script>
